import java.util.Scanner;
 
public class Lesson21 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        
        // 提示用户输入投资金额、年利率和投资年限
        System.out.print("Please enter the initial investment amount (e.g., 1000.50): ");
        double principalAmount = scanner.nextDouble();
        
        System.out.print("Please enter the annual interest rate (e.g., 4.25 for 4.25%): ");
        double annualInterestRate = scanner.nextDouble();
        
        System.out.print("Please enter the investment duration in years (e.g., 5): ");
        int investmentYears = scanner.nextInt();
        
        // 计算月利率和未来价值
        final int MONTHS_IN_YEAR = 12;
        double monthlyInterestRate = annualInterestRate / 100 / MONTHS_IN_YEAR;
        double futureValue = principalAmount * Math.pow(1 + monthlyInterestRate, investmentYears * MONTHS_IN_YEAR);
        
        // 输出结果（保留2位小数，格式化为货币）
        System.out.println("The final accumulated value is: $" + String.format("%.2f", futureValue));
        
        scanner.close();
    }
}